package com.nl.lib_project.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.nl.lib_core.tool.extends.setColor
import com.nl.lib_project.R
import com.nl.lib_project.entity.AlzheimerKeyValue

class AlzheimerLookBackChildAdapter :
    BaseQuickAdapter<AlzheimerKeyValue, BaseViewHolder>(R.layout.item_alzheimer_look_back_child) {
  override fun convert(holder: BaseViewHolder, item: AlzheimerKeyValue) {
    holder.getView<TextView>(R.id.mKey).text = item.mKey
    val valueView: TextView = holder.getView(R.id.mValue)
    item.mValue?.let {
      if (it) {
        valueView.text = "正确"
        valueView.setColor(R.color.project_main_color)
      } else {
        valueView.text = "错误"
        valueView.setColor(R.color.color_red)
      }
    }
  }
}
